<% include("/admin/comm/header.html"){} %>

<script>
function deleteKeyword(id){
    if(confirm("确定删除此关键字么？\r\n删除后其对应的文本回复或图文回复都将失效！！")){
        $.get("${ctxPath}/mpp/reply/keyword/delete/"+id, function(data){
            if(0 == data.code){
                location.reload();
            }else{
                $.promptBox(data.msg, "#ffb848");
            }
        });
    }
}
</script>

<div class="c_nav">
    <div class="ti">关键字回复</div>
</div>
<!--Content-->
<div class="c_content">
    <!--Title-->
    <div class="title txt_r">
        <a class="bgre va_m" href="${ctxPath}/view?url=/admin/mpp/reply.keyword&o=add">+新增关键字</a>
    </div>
    <!--/Title-->
    <!--Table list-->
    <table class="tab_list" width="100%">
        <tr>
            <th>关键字</th>
            <th>类型</th>
            <th>内容</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        <%for(reply in page.content){%>
            <tr>
                <td><span>${reply.keyword}</span></td>
                <td><span>${reply.type==0?'文本' : reply.type==1?'图文' : reply.type==2?'图片' : reply.type==3?'活动' : reply.type==4?'转发到多客服':'未知'}</span></td>
                <td><span>${strutil.length(reply.content)>32 ? strutil.subStringTo(reply.content, 0, 32)+"..." : reply.content}</span></td>
                <td><span>${reply.updateTime, dateFormat="yyyy-MM-dd HH:mm"}</span></td>
                <td>
                    <a class="c09f mr_15" href="${ctxPath}/view?url=/admin/mpp/reply.keyword&id=${reply.id}">查看</a>
                    <a class="c09f mr_15" href="${ctxPath}/view?url=/admin/mpp/reply.keyword&o=update&id=${reply.id}">编辑</a>
                    <a class="c09f" href="javascript:deleteKeyword(${reply.id});">删除</a>
                </td>
            </tr>
        <%}%>
    </table>
    <!--/Table list-->
    <% include("/admin/comm/page.html", {url:'${ctxPath}/mpp/reply/keyword/list'}){} %>
</div>
<!--/Content-->

<% include("/admin/comm/footer.html"){} %>